package com.ilop.sthome.mvp.contract.device;

import android.content.Intent;

import com.example.common.mvp.IBasePresenter;
import com.example.common.mvp.IBaseView;
import com.ilop.sthome.data.greenDao.DeviceInfoBean;

import java.util.List;

/**
 * @author skygge
 * @date 2020-04-06.
 * GitHub：javofxu@github.com
 * email：skygge@yeah.net
 * description：
 */
public interface SocketLinkageContract {

    interface IView extends IBaseView{

        void showInputList(List<DeviceInfoBean> input);

        void showOutputList(List<DeviceInfoBean> output);

        void startActivityByIntent(Intent intent);

        void showProgress();

        void showMsg(String msg);

        void finishActivity();
    }

    interface IPresent extends IBasePresenter<IView>{

        boolean getAutomationInfo(int mid, String deviceName);

        void getInputList();

        void getOutputList(String deviceName, int deviceId);

        void setInputList(List<DeviceInfoBean> deviceList);

        void setOutputList(List<DeviceInfoBean> deviceList);

        void addNewInput();

        void updateAction(boolean isInput, int position);

        void deleteAction(boolean isInput);

        void onSendAutomation();

        void onSendSuccess(String autoId);

        void onDeleteAutomation();

        void onDeleteSuccess();

        boolean checkInput(DeviceInfoBean device);

        void checkUpdateInput(DeviceInfoBean device);

        void checkUpdateOutput(DeviceInfoBean device);

        void whetherToSave(boolean hasModify);
    }
}
